Restructure into 3 packages for optional, prebuilt engine distribution#21
Merged
Conversation
Split the project into a monorepo of three separately-published packages so engines can be installed optionally with binaries embedded in PyPI wheels: - python-redlines (packages/core): pure-Python wrapper, py3-none-any wheel - python-redlines-ooxmlpowertools: Open-XML-PowerTools binary, per-platform wheels - python-redlines-docxodus: Docxodus binary, per-platform wheels Engines install via extras: pip install python-redlines[docxodus|ooxmlpowertools|all]. Binaries are prebuilt per platform and embedded in each binary package's wheel, so no .NET SDK or local compilation is needed to install or use the library. - engines.py locates its binary package via importlib.resources, extracts the platform archive into the user cache dir (not site-packages), and raises EngineNotInstalledError with install guidance when a companion package is missing - hatch_build.py stamps each binary wheel with the correct platform tag - build_differ.py builds a given RID into each package's _binaries/ dir - CI builds per-platform wheels across 3 OS runners; release publishes all three - Drop hatch/hatchling runtime deps and the build-on-install hook Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rework the README intro into a Quick Start that leads with Docxodus as the default, recommended engine and the optional prebuilt-engine install model. Drop the now-redundant Quick Example section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9a7a876 to
d793874
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the project into a monorepo of three separately-published PyPI packages so comparison engines can be installed optionally, with prebuilt binaries embedded in the wheels — no .NET SDK and no local compilation needed to install or use the library.
packages/corepython-redlinespy3-none-anypackages/ooxmlpowertoolspython-redlines-ooxmlpowertoolspackages/docxoduspython-redlines-docxodusEngines install via extras:
pip install python-redlines[docxodus]/[ooxmlpowertools]/[all]. Docxodus is the default/recommended engine.Why
The previous packaging bundled every platform's binary for both engines into a single
py3-none-anywheel (~900 MB projected) — unpublishable on PyPI (100 MB/file limit), wrong platform tag, andhatch/hatchlingleaked in as runtime deps. This makes genuine optional engines impossible (extras gate dependency packages, not files within one wheel).Changes
hatch_build.pybuild hook stamps each engine wheel with the correct platform tag (manylinux2014_x86_64,macosx_11_0_arm64,win_amd64, …). Each engine wheel is ~34–39 MB, well under PyPI limits;pipauto-selects the matching wheel.engines.py— locates its binary viaimportlib.resources, extracts the platform archive into the user cache dir (not read-onlysite-packages), and raisesEngineNotInstalledErrorwith install guidance when a companion package is missing.build_differ.py— reworked to build a given RID into each package's_binaries/dir.ci.ymltests per-OS and builds all wheels;python-publish.ymlbuilds per-platform engine wheels across 3 OS runners and publishes all three packages in lockstep (single version source inpackages/core/.../__about__.py).hatch/hatchlingruntime deps and the build-on-install hook.Test plan
twine checkpasses; correct platform tags; no leaked filespip install python-redlines[all]/[docxodus]/ core-only all behave correctly (incl.EngineNotInstalledError)site-packageslinux-x64platforms (linux-arm64,win-*,osx-*) — wired up but only exercised by CI; not verified locally🤖 Generated with Claude Code